<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title th:text="${content.title} + ' - 内容详情'">内容详情</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            background-color: #f5f5f5;
            color: #333;
            line-height: 1.6;
        }

        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
        }

        .back-nav {
            margin-bottom: 20px;
        }

        .back-btn {
            display: inline-block;
            padding: 8px 16px;
            background: #ecf0f1;
            color: #2c3e50;
            text-decoration: none;
            border-radius: 5px;
            transition: background 0.3s;
        }

        .back-btn:hover {
            background: #d5dbdb;
        }

        .content-article {
            background: white;
            padding: 40px;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        .content-header {
            border-bottom: 1px solid #eee;
            padding-bottom: 20px;
            margin-bottom: 30px;
        }

        .content-title {
            font-size: 28px;
            font-weight: bold;
            color: #2c3e50;
            margin-bottom: 15px;
        }

        .content-meta {
            display: flex;
            gap: 20px;
            color: #666;
            font-size: 14px;
        }

        .content-summary {
            background: #f8f9fa;
            padding: 20px;
            border-left: 4px solid #3498db;
            margin-bottom: 30px;
            font-style: italic;
            color: #555;
        }

        .content-body {
            font-size: 16px;
            line-height: 1.8;
            color: #444;
        }

        .content-stats {
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid #eee;
            display: flex;
            gap: 30px;
            justify-content: center;
        }

        .stat-item {
            text-align: center;
        }

        .stat-number {
            font-size: 24px;
            font-weight: bold;
            color: #3498db;
        }

        .stat-label {
            font-size: 12px;
            color: #666;
            margin-top: 5px;
        }

        .action-buttons {
            margin-top: 20px;
            text-align: center;
        }

        .action-btn {
            padding: 10px 20px;
            margin: 0 10px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            transition: background 0.3s;
        }

        .like-btn {
            background: #e74c3c;
            color: white;
        }

        .like-btn:hover {
            background: #c0392b;
        }

        .share-btn {
            background: #3498db;
            color: white;
        }

        .share-btn:hover {
            background: #2980b9;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="back-nav">
        <a href="javascript:history.back()" class="back-btn">← 返回搜索</a>
    </div>

    <article class="content-article">
        <header class="content-header">
            <h1 class="content-title" th:text="${content.title}">内容标题</h1>
            <div class="content-meta">
                <span th:text="'作者ID: ' + ${content.authorId}">作者ID: </span>
                <span th:text="'发布时间: ' + ${#temporals.format(content.createTime, 'yyyy-MM-dd HH:mm')}">发布时间: </span>
                <span th:if="${content.categoryId != null}" th:text="'分类ID: ' + ${content.categoryId}">分类ID: </span>
            </div>
        </header>

        <div class="content-summary" th:if="${content.summary != null}" th:text="${content.summary}">
            内容摘要
        </div>

        <div class="content-body" th:text="${content.content}">
            内容正文
        </div>

        <div class="content-stats">
            <div class="stat-item">
                <div class="stat-number" th:text="${content.viewCount} ?: 0">0</div>
                <div class="stat-label">浏览量</div>
            </div>
            <div class="stat-item">
                <div class="stat-number" th:text="${content.likeCount} ?: 0">0</div>
                <div class="stat-label">点赞数</div>
            </div>
        </div>

        <div class="action-buttons">
            <button class="action-btn like-btn" onclick="likeContent()">点赞</button>
            <button class="action-btn share-btn" onclick="shareContent()">分享</button>
        </div>
    </article>
</div>

<script>
    function likeContent() {
        // 这里可以添加点赞逻辑
        alert('点赞功能待实现');
    }

    function shareContent() {
        // 这里可以添加分享逻辑
        navigator.clipboard.writeText(window.location.href)
            .then(() => alert('链接已复制到剪贴板'))
            .catch(() => alert('分享功能待实现'));
    }
</script>
</body>
</html>